package cn.com.bdqn.dao;

import cn.com.bdqn.entity.SyDept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SyDeptDao {

    @Select("select * from sy_dept")
    public List<SyDept> queryAll();

    @Select("select * from sy_dept where id = #{value}")
    public SyDept queryById(Long id);

    public int updateSyDept(SyDept syDept);

    @Delete("delete from sy_dept where id = #{value}")
    public int delSyDept(Long id);

    @Insert("insert into sy_dept values\n" +
            "(default,#{deptName},#{remark},0)")
    public int addSyDept(SyDept syDept);
}
